//
//  CharacterToolCollectionViewCell.m
//  us
//
//  Created by karry on 2025/4/1.
//

#import "CharacterToolCollectionViewCell.h"

@implementation CharacterToolCollectionViewCell


-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initialization];
    }
    return self;
}

-(void)initialization{
    
    
    [self imgView];
    [self nameLab];
    
  
    self.contentView.alpha = 0.6;

}

- (void)setSelected:(BOOL)selected{
    [super setSelected:selected];
    //    未选中透明度60%
    self.contentView.alpha = selected ? 1 : 0.6;
 }

-(UIImageView *)imgView{
    if (!_imgView) {
        _imgView = [[UIImageView alloc]init];
         [self.contentView addSubview:_imgView];
         [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
             make.top.equalTo(self.contentView);
             make.left.equalTo(self.contentView);
        }];
    }
    return _imgView;
}
-(UILabel *)nameLab{
    if (!_nameLab) {
        _nameLab = [[UILabel alloc]init];
         [self.contentView addSubview:_nameLab];
        _nameLab.textColor = UIColor.titleColor;
        _nameLab.font = [UIFont systemFontOfSize:14];
         [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
             make.centerY.equalTo(self.imgView);
             make.left.equalTo(self.imgView.mas_right).offset(4);
        }];
    }
    return _nameLab;
}
 

@end
